#include <bits/stdc++.h>
using namespace std;
struct student{
	long num;
	string name;
	int chiness;
	int math;
	int english;
	struct student *next;
};
struct student p;
void creat()
{
	int n, c, m, e;
	string s;
	cin >> n >> s >> c >> m >> e;
	struct student newstudent = new student;
	newstudent.num = n, newstudent.chiness = c, newstudent.english = e, newstudent.math = m, newstudent.name = s;
	newstudent -> next = p -> next;
	p -> next = newstudent;
}
void print()
{
	do{
		cout << p.num << " " << p.name << " " << p.chiness << " " << p.math << " " << p.english << endl;
		p = p -> next;
	}while(p != NULL)
}
void change()
{
	int a;
	cin >> a;
	while(p.num != a)
		p = p -> next;
	p = p -> next;
	int c, d, e;
	string b;
	cin >> a >> b >> c >> d >> e;
	p.num = a, p.name = b, p.chiness = c, p.math = d, p.english = e;
}
void del()
{
	int a;
	cin >> a;
	while(p.num != a)
		p = p -> next;
	student d = p -> next;
	p -> next = d -> next;
}
int main() {
	while(1)
	{
		cout << "1.添加学生信息\n2.显示学生全部成绩\n3.按座位号删除学生记录\n4.按座位号修改学生记录\n0.退出\n";
		int a, n = 0;
		cin >> a;
		switch(a)
		{
			case 0:
				break;
			case 1:
				creat();
			case 2:
				print();
			case 3:
				del();
			case 4:
				change();
		}
	}
	return 0;
}